﻿@model Citi.EmailSender.WebUi.Models.EmailFilterModel
<h3>
    Filter</h3>
@using (Ajax.BeginForm("EmailDashboard", new AjaxOptions { UpdateTargetId = "EmailList", LoadingElementId= "imgFilterEmailLoading" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <div class="floatLeft" style="width: 33%">
            <div>
                @Html.LabelFor(model => model.StartDate)
                @Html.TextBoxFor(model => model.StartDate, new { @class = "date" })
            </div>
            <div>
                @Html.LabelFor(model => model.ApplicationId)
                @Html.DropDownListFor(model => model.ApplicationId, (SelectList)ViewBag.Applications)
            </div>
        </div>
        <div class="floatLeft" style="width: 33%">
            <div>
                @Html.LabelFor(model => model.EndDate)
                @Html.TextBoxFor(model => model.EndDate, new { @class = "date" })
            </div>
            <div>
                @Html.LabelFor(model => model.OnBehalfOfId)
                @Html.DropDownListFor(model => model.OnBehalfOfId, (SelectList)ViewBag.OnBehalfOfs)
            </div>
        </div>
        <div class="floatLeft" style="width: 33%">
            <div>
                @Html.LabelFor(model => model.Subject)
                @Html.EditorFor(model => model.Subject)
            </div>
            <div>
                @Html.LabelFor(model => model.Approval)
                @Html.DropDownListFor(model => model.Approval, (IEnumerable<SelectListItem>)ViewBag.ApprovalStatus)
            </div>
        </div>
        <p>
            <input type="submit" value="  Search  " id="emailFilterSubmit" class="btn btn-primary" />&nbsp;&nbsp;
            <img src="@Url.Content("~/Content/Images/Loading.gif")" alt="Loading" id="imgFilterEmailLoading" style="width:25px;" />
        </p>
    </fieldset>
}
